﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IGolovkine.Core.Linq
{
    public static class IEnumerableExtensions
    {
        public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> action)
        {
            foreach (T el in enumerable)
            {
                action(el);
            }
        }

        public static IEnumerable<O> ConvertAll<T, O>(this IEnumerable<T> enumerable, Converter<T, O> converter)
        {
            foreach (T el in enumerable)
            {
                yield return converter(el);
            }
        }
    }
}
